package com.jxnu.escms.Dao.InOutDao;

import com.jxnu.escms.Pojo.InOutRecord;
import com.jxnu.escms.Pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface InOutDao {
    /**
     * 添加出入申请
     * @param data
     * @return
     */
    public int insertApplication(Map<String, Object> data);

    /**
     * 通过用户id获取对应的申请记录
     * @param userId
     * @return
     */
    public List<InOutRecord> getAllById(int userId);

    /**
     * 通过id获得admin
     * @param id
     * @return
     */
    public String getAdmin(int id);

    /**
     * 通过用户id和申请时间删除记录
     * @param userId
     * @param applicationTime
     * @return
     */
    public int deleteRecord(int userId, String applicationTime);

    public List<InOutRecord> getAllByAdminId(int adminId, int kill);

    public int updateResult(int id, String result);

    public int insertRecord(int admin, int record, String type, String time);

    public int deleteById(int id);
}
